<template>
  <el-backtop :bottom="100" :right="30">
    <div class="backtop-box">
      <el-icon class="icon"><Top /></el-icon>
      <div class="text">返回顶部</div>
    </div>
  </el-backtop>
</template>

<script setup>
import { Top } from '@element-plus/icons-vue'
</script>

<style scoped>
.backtop-box {
  width: 64px;
  height: 64px;
  background-color: #bbc7d4;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(166, 186, 206, 0.3);
  transition: all 0.3s ease-in-out;
  cursor: pointer;
  border-radius: 2px; /* 可选：稍微圆角，不是圆形 */
  font-size: 12px;
  text-align: center;
  line-height: 1.2;
}

.backtop-box:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(64, 158, 255, 0.45);
}

.icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.text {
  font-size: 10px;
}

/* 小屏缩小按钮 */
@media (max-width: 768px) {
  .backtop-box {
    width: 52px;
    height: 52px;
  }

  .icon {
    font-size: 18px;
  }

  .text {
    font-size: 9px;
  }
}
</style>
